#ifndef __RINGBUFFER_H_
#define __RINGBUFFER_H_

#define ringBuffDebug   0

#include "stdint.h"

typedef struct ringbuff
{
    uint8_t read_index;
    uint8_t write_index;
    uint16_t buff_size;
    uint8_t buff_ptr[];
} ringbuff_t;

typedef enum buff_state {
    Buff_NORMAL,
    Buff_EMPTY,
    Buff_FULL,
} buff_state_e;

void ringBuff_Init(uint16_t buf_size);
uint16_t ringBuff_Write(uint8_t *ptr, uint16_t length);
uint16_t ringBuff_Read(uint8_t *ptr, uint16_t length);

#endif